// 加载层
var loadIndex = layer.load(1, { shade: [0.5, '#fff'] })
    // 定义一个async异步函数
async function getRealme() {
    var realme = document.querySelector('.realme .con aside');
    var realme_list = await pAjax({
        url: '../server/realme.php',
        data: { pid: 7 }
    });
    var { data } = realme_list;
    var str = '';
    str = ` <img src="${data[0].imgpath}" alt="">`
    for (var i = 1; i < data.length; i++) {
        str += `
            <div class="title">
            <img src="${data[i].imgpath_litte}" alt="">
            <p>${data[i].name}</p>
            <li><b>${data[i].b}</b></li>
            <span>${data[i].price}<s>${data[i].s}</s></span>
        </div>`
    }
    realme.innerHTML = str;
    // *******************************************
    var goods = document.querySelector('.goods .con aside');
    var goods_list = await pAjax({
        url: '../server/realme.php',
        data: { pid: 10 }
    });
    var { data } = goods_list;
    var str7 = '';
    str7 = ` <img src="${data[0].imgpath}" alt="">`
    for (var i = 1; i < data.length; i++) {
        if (i == 1 || i == 2) {
            str7 += `
            <div class="title">
            <img src="${data[i].imgpath_litte}" alt="">
            <p>${data[i].name}</p>
            <span>${data[i].price}<s>${data[i].s}</s></span>
        </div>`
        } else {
            str7 += `
            <div class="title">
            <img src="${data[i].imgpath_litte}" alt="">
            <p>${data[i].name}</p>
            <li><b>${data[i].b}</b></li>
            <span>${data[i].price}<s>${data[i].s}</s></span>
        </div>`
        }
    }
    goods.innerHTML = str7;
}
layer.close(loadIndex)

getRealme()